package cn.sinata.wanglin.adapter;

import com.xilada.xldutils.adapter.HFRecyclerAdapter;
import com.xilada.xldutils.adapter.util.ViewHolder;

import java.util.List;

import cn.sinata.wanglin.R;
import cn.sinata.wanglin.model.Message;
import cn.sinata.wanglin.utils.RelativeDateFormat;


/**
 *
 * Created by liaoxiang on 16/6/20.
 */
public class MessageAdapter extends HFRecyclerAdapter<Message> {
    public MessageAdapter(List<Message> mData) {
        super(mData, R.layout.item_message_layout);
    }

    @Override
    public void onBind(int position, Message message, ViewHolder holder) {
        holder.setText(R.id.tv_title,message.getTitle());
        holder.setText(R.id.tv_time, RelativeDateFormat.getTimeYMDHMS(message.getCreate_date()));
        holder.setText(R.id.tv_content, message.getNotice_content());
    }
}
